from  random import*
a=0
b=0
c=0
print("一共12个球：红球3个  黄球3个  绿球6个")
print("请写出您想随机选球的次数：")
while 1:
    n=int(input())
    for i in range(n):
        num=0
        print("第%d次选择："%(i+1),end='')
        while num!=8:
            a=randint(1,3)
            b=randint(1,3)
            c=randint(1,6)
            num=a+b+c
        print("红球%d个，黄球%d个，绿球%d个"%(a,b,c))
    break
